<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户后台登陆!!!</title>
<link rel="stylesheet" type="text/css" href="{$SKIN}movelogin/css/style.css" />
<link rel="stylesheet" type="text/css" href="{$SKIN}movelogin/css/body.css"/> 
<!---
<script src="{$SKIN}layui/js/jquery-2.1.4.min.js"></script>

--->
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>

<style>
#js-server-helpinfo{
	color:red;
}
</style>
<script>
function gjson(d){
	if(d.substr(0,1) != '{'){
		$('body').before(d);
	}
	d = $.parseJSON(d);	
	return d;
}

$(document).ready(function(c) {
	
	$('.submit').click(function(){
		user = $('[name=username]').val();
		password = $('[name=password]').val();
		url = "{url c='index'}";
		if(!user){
			$('#js-server-helpinfo').html("请输入用户名");
			$('[name=username]').focus();
			return false;
		}
		if(!password){
			$('#js-server-helpinfo').html("请输入密码");
			$('[name=password]').focus();
			return false;
		}
		
		$.post(url,{'m':'dologin','user':user,'password':password},function(back){
			
			d = gjson(back);
			
			if(d.status){
				$('#js-server-helpinfo').html("登陆成功");
				setTimeout(function(){
					self.location.href=d.url;
				},2000);
			}else{
				$('#js-server-helpinfo').html(d.msg);
			}
		});
		return false;
	});
});
</script>
</head>
<body>



<div class="container">
	<section id="content">
		<form onsubmit="">
			<h1>会员登录</h1>
			<div>
				<input type="text" placeholder="邮箱" required="" id="username" name="username" value="{$user}"/>
			</div>
			<div>
				<input type="password" placeholder="密码" required="" id="password" name="password" value="{$password}"/>
			</div>
			 <div class="">
				<span class="help-block u-errormessage" id="js-server-helpinfo">&nbsp;</span>			</div> 
			<div>
				<!-- <input type="submit" value="Log in" /> -->
				<input type="submit" value="登录" class="btn btn-primary submit" id="js-btn-login"/>
				<a href="#">忘记密码?</a>
				<!-- <a href="#">Register</a> -->
			</div>
		</form><!-- form -->
		 <div class="button">
			<span class="help-block u-errormessage" id="js-server-helpinfo">&nbsp;</span>
			
			<p>Copyright &copy; 2017 <a href="http://www.kupebank.com/" target="_blank" title="陈阳昇工作室">陈阳昇工作室</a> All rights reserved.</p>
		</div> <!-- button -->
	</section><!-- content -->
</div>
<!-- container -->
</body>
</html>